package com.systop.domain.vo;

import com.systop.validator.group.AddGroup;
import com.systop.validator.group.DelGroup;
import com.systop.validator.group.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Description: TODO
 * @Author: jsj
 * @Date: 2023/2/19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsStockVo implements Serializable {
    @NotNull(groups = {AddGroup.class, UpdateGroup.class},message = "商品ID不能为空")
    private Long goodsId;
    @Min(value = 0,groups = {AddGroup.class, UpdateGroup.class},message = "库存量不能小于0")
    @Max(value = -1,groups = DelGroup.class,message = "减少量不能小于1")
    private Integer stockNum;
}
